#include <stdio.h>

int main()
{ 
    int a[100] = {1, 21, 24, 35, 45, 56, 67, 78, 89, 99};
    int num, temp;
    int n = 10;

    printf("原始数组：\n");
    for(int i = 0; i < n; i++)
    {
        printf("%d ", a[i]);
    }
    printf("\n");

    printf("请输入一个整数：\n");
    scanf("%d", &num);

    for(int i = 0; i < n; i++)
    {
        if(num < a[i])
        {       
            temp = i;
            break;
        }
    }
    for(int j = n; j > temp; j--)
    {
        a[j] = a[j-1];
    }
    a[temp] = num;
    n++;
    
    printf("插入后的数组：\n");
    for(int i = 0;i < n; i++)
    {
        printf("%d ",a[i]);
    }
    printf("\n");

    return 0;
} 